/**
 * Copyright 2013 ABSir's Studio
 * 
 * All right reserved
 *
 * Create on 2013-7-11 上午10:21:25
 */
package com.absir.android.orm;

import java.util.HashMap;
import java.util.Map;

import android.database.Cursor;

/**
 * @author absir
 * 
 */
public class DaoCursorUtils {

	/**
	 * @param cursor
	 * @return
	 */
	public static Map<String, Object> getOneRow(Cursor cursor) {
		if (cursor.moveToNext()) {
			Map<String, Object> map = new HashMap<String, Object>();
			int count = cursor.getColumnCount();
			for (int i = 0; i < count; i++) {
				map.put(cursor.getColumnName(i), cursor.getShort(i));
			}

			return map;
		}

		return null;
	}

}
